<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of PlatformValidator
 *
 * @author USUARIO
 */
class PlatformValidator {


    public function PlatformExists($value = null , $type_search="id"){

         if($value!=null){
                $criterio_busqueda = new Criteria();
                if($type_search=="id"){
                   $platformBean =  PlataformaPeer::retrieveByPK($value);
                   if(is_object($platformBean)){
                      return array("success"=>true,"message" =>"<PlatformExists> => success" , "object" => $platformBean);
                   }else{
                      return array("success"=>false,"message" =>"<PlatformExists> => objeto no encontrado");
                   }
                }elseif($type_search=="name"){
                   $criterio_busqueda->add(PlataformaPeer::DESCRIPCION, $value);
                   $platformBean = PlataformaPeer::doSelectOne($criterio_busqueda);
                   if(is_object($platformBean)){
                      return array("success"=>true,"message" =>"<PlatformExists> => success" , "object" => $platformBean);
                   }else{
                      return array("success"=>false,"message" =>"<PlatformExists> => objeto no encontrado");
                   }
                }
            }else{
                return array("success"=>false,"message" =>"<PlatformExists> => parametro invalido");
            }

}






}
?>
